Can you explain me multilevel inheritance
1471
08-Nov-2016
Elena Glibart
08-Nov-2016We will extend our single-level class hierarchy to multiple levels. A BankAccount inherits from Asset. A bank account can be one of two types: savings or checking. Therefore, we can say the following:
·A bank account “is an” asset.
·A savings account “is a” type of bank account.
·A checking account “is a” type of bank account.
Thus, we could add two more classes, called SavingsAccount and CheckingAccount, to our class hierarchy to represent these additional real-life entities. This is shown in the UML diagram here: